﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Brjostagjof_H4.Models.ChangePasswordModel>" %>

<asp:Content ID="changePasswordTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Brjóstagjöf.is | Breyta lykilorði
</asp:Content>

<asp:Content ID="changePasswordContent" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Breyta lykilorði</h3>
    <table id="main-table">
        <tr>

            <td id="main-table-left">
            <p>Nýja lykilorðið verður að vera að minnsta kosti <%: ViewData["PasswordLength"] %> stafir að lengd.</p>

            <% using (Html.BeginForm()) { %>
        
                <div>
                    <fieldset class="input-form">
                        <legend>Notendaupplýsingar</legend>
                
                        <%: Html.ValidationSummary(true, "Breytingin tókst ekki. Vinsamlegast yfirfarðu villurnar og reyndu aftur.") %>

                        <div class="editor-label">
                            <%: Html.LabelFor(m => m.OldPassword) %>
                        </div>
                        <div class="editor-field">
                            <%: Html.PasswordFor(m => m.OldPassword) %>
                            <%: Html.ValidationMessageFor(m => m.OldPassword) %>
                        </div>
                
                        <div class="editor-label">
                            <%: Html.LabelFor(m => m.NewPassword) %>
                        </div>
                        <div class="editor-field">
                            <%: Html.PasswordFor(m => m.NewPassword) %>
                            <%: Html.ValidationMessageFor(m => m.NewPassword) %>
                        </div>
                
                        <div class="editor-label">
                            <%: Html.LabelFor(m => m.ConfirmPassword) %>
                        </div>
                        <div class="editor-field">
                            <%: Html.PasswordFor(m => m.ConfirmPassword) %>
                            <%: Html.ValidationMessageFor(m => m.ConfirmPassword) %>
                        </div>
                
                        <div>
                            <input type="submit" value="Breyta lykilorði" />
                            <span class="cancel-link"><%: Html.ActionLink("Hætta við", "Entries", "Admin") %></span>
                        </div>
                    </fieldset>
                </div>
            <% } %>
            </td>

            <td id="main-table-right">
                <div class="options">
                    <% if (User.IsInRole("Administrators")){Html.RenderPartial("~/Views/Home/ProfileAdminMenu.ascx", "Model");} %>
                    <% else if (User.IsInRole("Professionals")) { Html.RenderPartial("~/Views/Home/ProfileProMenu.ascx", "Model"); } %>
                    <% else { Html.RenderPartial("~/Views/Home/ProfileMenu.ascx", "Model"); } %>
                </div>
            </td>

        </tr>
    </table>
    
</asp:Content>
